package live.zs;

import io.quarkus.runtime.Quarkus;
import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.annotations.CommandLineArguments;
import io.quarkus.runtime.annotations.QuarkusMain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import java.util.Arrays;

/**
 * @author madison
 * @description
 * @date 2022/2/3 21:12
 */
@QuarkusMain
public class Main {
    private static Logger logger = LoggerFactory.getLogger(Main.class);

    @Inject
    @CommandLineArguments
    String[] args;

    public static void main(String[] args) {
        logger.info("Running main method");
        Arrays.stream(args).forEach(logger::info);
        Quarkus.run(MyApp.class, args);
    }

    public static class MyApp implements QuarkusApplication {

        @Override
        public int run(String... args) throws Exception {
            logger.info("Do startup logic here");
            Arrays.stream(args).forEach(logger::info);
            Quarkus.waitForExit();
            return 0;
        }
    }
}
